import utils.XMLFileHandler;
import junit.framework.TestCase;
import container.WeaponTraitDescription;
import container.WeaponTraitDescriptions;
import enums.StandartFileNames;


public class WeaponTrait_Tests extends TestCase{

	public void test_createWeaponTraits(){
		WeaponTraitDescriptions descriptions = new WeaponTraitDescriptions();
		
		
		WeaponTraitDescription trait1 = new WeaponTraitDescription();
		trait1.setRatedTrait(false);
		trait1.setTraitName("Anti-Aircraft");
		trait1.setTraitCode("AA");
		trait1.setRatingFormula("1.05");
		trait1.setDescription("Allows to attack airstrikes");
		
		WeaponTraitDescription trait2 = new WeaponTraitDescription();
		trait2.setRatedTrait(false);
		trait2.setTraitName("Anti-Infantry");
		trait2.setTraitCode("AI");
		trait2.setRatingFormula("1.2");
		trait2.setDescription("Against Infantry +2 for attack rolls.");
		
		WeaponTraitDescription trait3 = new WeaponTraitDescription();
		trait3.setRatedTrait(true);
		trait3.setTraitName("Area Effect (x)");
		trait3.setTraitCode("AE(x)");
		trait3.setRatingFormula("1+0.15*x");
		trait3.setDescription("Area effect attack with an x-inch radius.");
		
		WeaponTraitDescription trait4 = new WeaponTraitDescription();
		trait4.setRatedTrait(false);
		trait4.setTraitName("Armor Crushing");
		trait4.setTraitCode("AC");
		trait4.setRatingFormula("1.1");
		trait4.setDescription("Reduced armor by any hit.");
		
		WeaponTraitDescription trait5 = new WeaponTraitDescription();
		trait5.setRatedTrait(false);
		trait5.setTraitName("Armor Piercing");
		trait5.setTraitCode("AP");
		trait5.setRatingFormula("2");
		trait5.setDescription("Add 2 to any MoS of 0+.");
		
		WeaponTraitDescription trait6 = new WeaponTraitDescription();
		trait6.setRatedTrait(true);
		trait6.setTraitName("Blast (x)");
		trait6.setTraitCode("B(x)");
		trait6.setRatingFormula("1+0.25*x");
		trait6.setDescription("Area effect attack with does at least minimum damage in x-inch radius.");
		
		descriptions.addTraitDescription(trait1);
		descriptions.addTraitDescription(trait2);
		descriptions.addTraitDescription(trait3);
		descriptions.addTraitDescription(trait5);
		descriptions.addTraitDescription(trait6);
		descriptions.addTraitDescription(trait4);
		
		XMLFileHandler.storeWeaponTraits(descriptions, "XML_Files/"
				+ StandartFileNames.WEAPON_TRAIT_FILE.getFileName());
		
	}
}
